import {request, config} from 'utils'
import * as commonService from "utils/services";

const {api} = config;
const {distributor, level} = api;
export async function query(params = {}) {
  const url = `${distributor}/wxLite/root/list`;
  return request({ url: url, method: 'POST', data: params })
}
export async function queryDistributorChilds({invitationCode}) {
  const url = `${distributor}/wxLite/children/list/${invitationCode}`;
  return request({ url: url, method: 'POST', data: {} })
}
export async function queryDistributorDetail({id}) {
  const url = `${distributor}/wxLite/detail/${id}`;
  return request({ url: url, method: 'GET', data: {} })
}
export async function editDistributor({id,...params}) {
  const url = `${distributor}/wxLite/${id}/update`;
  return request({ url: url, method: 'PUT', data: params })
}
export async function queryDistributorLevels({id}) {
  const url = `${level}/distributorLevel/settingInfo/${id}`;
  return request({ url: url, method: 'GET', data: {} })
}

